<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>‘ 应答处理</title>
</head>
<body>
    
</body>

<script>
    let p1 = new Promise((resolve,reject)=>{
        // resolve("成功")
        reject("失败")
    })
    new Promise((resolve,reject)=>{
        resolve(p1)
    })
    .then(
        resolve=>{
        console.log("msg:  "+resolve)
    },reason=>{
        console.log("reason:  "+reason)
    } 
    )
    .catch(reason=>{
        console.log("error:  "+reason)
    })

    // resolve接收的数据如果是promise类型，需要根据该promise的返回结果进行选择触发.then中的resolve还是reason 或者是.catch

    // promise中没表示事件处理状态时，.then不会执行 错误的

    


    
</script>
</html>